From: Florian Müllner Date: Tue, 2 Aug 2022 09:33:37 +0000 (+0200) Subject: status/network: Remove status from VPN item X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~461^2^2~129 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=9bca544dd6a0b2fdbb7fb8911f7fabf982dee4d6;p=gnome-shell.git status/network: Remove status from VPN item It's odd to swap out a switch with a status label, and the information isn't that helpful to begin with: It's either transient (connecting, deactivating, ...), or too little to be meaningful (unknown, failed, ...). We're also perfectly happy to not show it in "label mode" (i.e. when there's just one VPN). Just get rid of it. Part-of: --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index ff9c29650..547dadc36 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -1406,30 +1406,9 @@ var NMWireguardItem = class extends NMConnectionItem { let isActive = this.isActive(); this.labelItem.label.text = isActive ? _('Turn Off') : this._section.getConnectLabel(); this.radioItem.setToggleState(isActive); - this.radioItem.setStatus(this._getStatus()); this.emit('icon-changed'); } - _getStatus() { - if (this._activeConnection === null) - return null; - - switch (this._activeConnection.state) { - case NM.ActiveConnectionState.UNKNOWN: - return _('unknown'); - case NM.ActiveConnectionState.ACTIVATING: - return _('activating…'); - case NM.ActiveConnectionState.ACTIVATED: - return null; - case NM.ActiveConnectionState.DEACTIVATING: - return _('deactivating…'); - case NM.ActiveConnectionState.DEACTIVATED: - return _('deactivated'); - default: - return 'invalid'; - } - } - _connectionStateChanged() { const state = this._activeConnection?.get_state(); const reason = this._activeConnection?.get_state_reason(); @@ -1477,32 +1456,9 @@ var NMVpnConnectionItem = class extends NMConnectionItem { let isActive = this.isActive(); this.labelItem.label.text = isActive ? _("Turn Off") : this._section.getConnectLabel(); this.radioItem.setToggleState(isActive); - this.radioItem.setStatus(this._getStatus()); this.emit('icon-changed'); } - _getStatus() { - if (this._activeConnection == null) - return null; - - switch (this._activeConnection.vpn_state) { - case NM.VpnConnectionState.DISCONNECTED: - case NM.VpnConnectionState.ACTIVATED: - return null; - case NM.VpnConnectionState.PREPARE: - case NM.VpnConnectionState.CONNECT: - case NM.VpnConnectionState.IP_CONFIG_GET: - return _("connecting…"); - case NM.VpnConnectionState.NEED_AUTH: - /* Translators: this is for network connections that require some kind of key or password */ - return _("authentication required"); - case NM.VpnConnectionState.FAILED: - return _("connection failed"); - default: - return 'invalid'; - } - } - _connectionStateChanged(ac, newstate, reason) { if (newstate === NM.VpnConnectionState.FAILED && reason !== NM.VpnConnectionStateReason.NO_SECRETS)